package com.migration.model.olddb;

import jakarta.persistence.*;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.io.Serializable;

/**
 * 防护措施表 实体类
 * 表名：ra_defend_measures
 * 自动生成的实体类
 */
@Data
@Entity
@Table(name = "ra_defend_measures")
public class RaDefendMeasures implements Serializable {

    private static final long serialVersionUID = 1L;
    
    /**
     * 主键
     * 主键
     */
    @Id
    @Column(name = "id", nullable = false)
    private Long id;
    
    /**
     * 
     */
    @Column(name = "defend_code", length = 32)
    private String defendCode;
    
    /**
     * 描述
     */
    @Column(name = "defend_desc", length = 512)
    private String defendDesc;
    
    /**
     * 类型
     * 默认值: 0
     */
    @Column(name = "defend_type")
    private Byte defendType;
    
    /**
     * 所属节点
     */
    @Column(name = "node_id")
    private Long nodeId;
    
    /**
     * 消减等级
     */
    @Column(name = "pfd")
    private BigDecimal pfd;
    
    /**
     * 位号
     */
    @Column(name = "bit_num", length = 128)
    private String bitNum;
    
    /**
     * 类型参数JSON
     */
    @Column(name = "type_json", length = 512)
    private String typeJson;
    
    /**
     * 附件地址
     */
    @Column(name = "attachment_url", length = 512)
    private String attachmentUrl;
    
    /**
     * 防护措施PFD计算系数（0、移除 1、带入）
     * 默认值: 1
     */
    @Column(name = "factor_type")
    private Byte factorType;
    
    /**
     * 是否关联事故链（0、否 1、是）
     * 默认值: 0
     */
    @Column(name = "linked_fault_chains")
    private Byte linkedFaultChains;
    
    /**
     * 关联报警（0、未关联 1、已关联）
     * 默认值: 0
     */
    @Column(name = "linked_alarm")
    private Byte linkedAlarm;
    
    /**
     * 关联的报警位号
     */
    @Column(name = "alarm_bit_no", length = 65535)
    private String alarmBitNo;
    
    /**
     * 排序
     * 默认值: 0
     */
    @Column(name = "sort_no")
    private Integer sortNo;
    
    /**
     * 租户主键ID
     * 默认值: 1
     */
    @Column(name = "tenant_id")
    private Integer tenantId;
    
    /**
     * 是否删除（0、否1、是）
     * 默认值: 0
     */
    @Column(name = "is_del", nullable = false)
    private Byte isDel;
    
    /**
     * 创建时间
     * 默认值: CURRENT_TIMESTAMP
     */
    @Column(name = "create_time", nullable = false)
    private java.time.LocalDateTime createTime;
    
    /**
     * 创建者
     */
    @Column(name = "create_by", length = 64)
    private String createBy;
    
    /**
     * 更新时间
     * 默认值: CURRENT_TIMESTAMP
     */
    @Column(name = "update_time", nullable = false)
    private java.time.LocalDateTime updateTime;
    
    /**
     * 更新者
     */
    @Column(name = "update_by", length = 64)
    private String updateBy;
    
    @Override
    public String toString() {
        return "RaDefendMeasures{" +
            "id=" + id +
            ", defendCode=" + defendCode +
            ", defendDesc=" + defendDesc +
            ", defendType=" + defendType +
            ", nodeId=" + nodeId +
            ", pfd=" + pfd +
            ", bitNum=" + bitNum +
            ", typeJson=" + typeJson +
            ", attachmentUrl=" + attachmentUrl +
            ", factorType=" + factorType +
            ", linkedFaultChains=" + linkedFaultChains +
            ", linkedAlarm=" + linkedAlarm +
            ", alarmBitNo=" + alarmBitNo +
            ", sortNo=" + sortNo +
            ", tenantId=" + tenantId +
            ", isDel=" + isDel +
            ", createTime=" + createTime +
            ", createBy=" + createBy +
            ", updateTime=" + updateTime +
            ", updateBy=" + updateBy +
        '}';
    }
} 